package com.twu.biblioteca.view.command;

import com.google.inject.Inject;

import com.twu.biblioteca.controller.UserController;
import com.twu.biblioteca.view.console.ConsoleViewController;

public class LoginCommand extends Command {
  private final UserController controller;

  @Inject
  public LoginCommand(UserController controller) {
    this.controller = controller;
  }

  @Override
  public void execute(ConsoleViewController viewController) {
    this.consoleWriter.display("Enter a your Library Number (XXX-XXXX): ");
    String libraryNumber = this.consoleReader.readLine();
    this.consoleWriter.display("Enter a your Password: ");
    String password = this.consoleReader.readLine();

    this.controller.checkCredential(libraryNumber, password);
  }
}
